<html>
<head><meta charset="utf-8"><title>Path to stabilization · project-inline-asm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/index.html">project-inline-asm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html">Path to stabilization</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="225083036"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225083036" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225083036">(Feb 03 2021 at 21:14)</a>:</h4>
<p><span class="user-mention" data-user-id="143274">@Amanieu</span> Are you aware of any blocking issues that should prevent us from stabilizing inline assembly on architectures that have gotten sufficient testing?</p>



<a name="225083110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225083110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225083110">(Feb 03 2021 at 21:14)</a>:</h4>
<p>We discussed it in the lang design meeting today, and felt that we'd seen enough positive reports from users that we'd be prepared to stabilize it given a PR and stabilization report.</p>



<a name="225083171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225083171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225083171">(Feb 03 2021 at 21:15)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/72016#issuecomment-761616910">https://github.com/rust-lang/rust/issues/72016#issuecomment-761616910</a></p>



<a name="225083251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225083251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225083251">(Feb 03 2021 at 21:15)</a>:</h4>
<p>I made a list of potential blockers. There are some significant design issues around the handling of clobbers.</p>



<a name="225083985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225083985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225083985">(Feb 03 2021 at 21:20)</a>:</h4>
<p>Reading...</p>



<a name="225084091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225084091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225084091">(Feb 03 2021 at 21:21)</a>:</h4>
<p>(Also, sorry for missing your comment on the tracking issue.)</p>



<a name="225086470"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225086470" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225086470">(Feb 03 2021 at 21:38)</a>:</h4>
<p>I added another blocker, we need to resolve the question of namespacing the <code>asm!</code> macro under <code>core::arch</code>.</p>



<a name="225086531"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225086531" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225086531">(Feb 03 2021 at 21:38)</a>:</h4>
<p>At the moment, I'd be happy to just propose resolving that question as "no" and use an FCP to confirm lang team consensus on that.</p>



<a name="225086635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225086635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225086635">(Feb 03 2021 at 21:39)</a>:</h4>
<p>In any case, the only problem that needs real design work is <a href="https://github.com/rust-lang/rust/issues/81092">#81092</a>.</p>



<a name="225086757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225086757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225086757">(Feb 03 2021 at 21:40)</a>:</h4>
<p>The named labels has a WIP PR to resolve it, version check should be easy to implement and inline consts vs explicit promotion in theory shouldn't affect semantics.</p>



<a name="225086834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225086834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225086834">(Feb 03 2021 at 21:40)</a>:</h4>
<p>I just posted a note to the named labels issue.</p>



<a name="225086906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225086906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225086906">(Feb 03 2021 at 21:41)</a>:</h4>
<p>(Summary: I'd like to either catch and reject named labels, or catch and reject <code>.global</code>/<code>.globl</code>, so that we don't silently miscompile code that expects <code>".globl foo\nfoo: ..."</code> to work.)</p>



<a name="225087010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087010">(Feb 03 2021 at 21:42)</a>:</h4>
<p>Can you point me to the code in Linux that does this?</p>



<a name="225087023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087023">(Feb 03 2021 at 21:42)</a>:</h4>
<p>I'm pretty sure it's incorrect</p>



<a name="225087091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087091">(Feb 03 2021 at 21:42)</a>:</h4>
<p><code>git grep globl -- '*.[ch]' | grep -v 'printf'</code> will turn up several cases.</p>



<a name="225087113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087113">(Feb 03 2021 at 21:42)</a>:</h4>
<p>Also, in C it's easier to ensure that only one copy of an asm block gets emitted.</p>



<a name="225087126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087126">(Feb 03 2021 at 21:43)</a>:</h4>
<p>There are no generics, and it's possible to ensure a function isn't inlined.</p>



<a name="225087355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087355">(Feb 03 2021 at 21:45)</a>:</h4>
<p>OK I see. We should definitely lint against <code>.global</code> and <code>.globl</code> and recommend using <code>global_asm!</code> instead.</p>



<a name="225087410"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087410" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087410">(Feb 03 2021 at 21:45)</a>:</h4>
<p>However this should be a separate issue.</p>



<a name="225087549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087549">(Feb 03 2021 at 21:46)</a>:</h4>
<p><span class="user-mention silent" data-user-id="143274">Amanieu</span> <a href="#narrow/stream/216763-project-inline-asm/topic/Path.20to.20stabilization/near/225087410">said</a>:</p>
<blockquote>
<p>However this should be a separate issue.</p>
</blockquote>
<p>It isn't an issue until local label rewriting, though.</p>



<a name="225087569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087569">(Feb 03 2021 at 21:46)</a>:</h4>
<p>Which is part of why I think it makes sense to do as part of local label rewriting.</p>



<a name="225087587"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087587" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087587">(Feb 03 2021 at 21:46)</a>:</h4>
<p>In any case, that conversation can happen on the github issues.</p>



<a name="225087635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087635">(Feb 03 2021 at 21:46)</a>:</h4>
<p>/me reads <a href="https://github.com/rust-lang/rust/issues/81092">https://github.com/rust-lang/rust/issues/81092</a> .</p>



<a name="225087636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087636">(Feb 03 2021 at 21:46)</a>:</h4>
<p>I think this conversation should happpen on the tracking issue rather than the PR. Any linting would be in a separate PR anyways.</p>



<a name="225087823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087823">(Feb 03 2021 at 21:48)</a>:</h4>
<p>I brought it up on the PR because one option would be to reject non-local labels rather than rewriting them.</p>



<a name="225087831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087831">(Feb 03 2021 at 21:48)</a>:</h4>
<p>(That'd be my preferred alternative.)</p>



<a name="225087862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225087862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225087862">(Feb 03 2021 at 21:48)</a>:</h4>
<p>If that's not the path we go with, then yeah, further discussion on things like rejecting global directives could happen on the tracking issue.</p>



<a name="225088108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225088108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225088108">(Feb 03 2021 at 21:50)</a>:</h4>
<p>I'd prefer rejecting for initial stabilization as well.</p>



<a name="225088298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225088298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225088298">(Feb 03 2021 at 21:51)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> Can you copy your comment to <a href="https://github.com/rust-lang/rust/issues/81088">#81088</a>? Let's continue the discussion there.</p>



<a name="225088472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225088472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225088472">(Feb 03 2021 at 21:52)</a>:</h4>
<p>Nevermind I'll just quote it</p>



<a name="225088556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225088556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225088556">(Feb 03 2021 at 21:53)</a>:</h4>
<p>Already done.</p>



<a name="225088679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225088679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225088679">(Feb 03 2021 at 21:54)</a>:</h4>
<p>I agree that the version check should be simple and straightforward.</p>



<a name="225088711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225088711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225088711">(Feb 03 2021 at 21:54)</a>:</h4>
<p>And I agree that const handling shouldn't be a blocker.</p>



<a name="225088984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225088984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225088984">(Feb 03 2021 at 21:56)</a>:</h4>
<p><code>clobber</code> seems like a perfectly reasonable syntax, including the <code>clobber("C")</code> and <code>clobber("all")</code> cases. Albeit, we'd have to define "all" a little carefully, as there may be registers on some architectures that never make sense to "clobber".</p>



<a name="225089097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225089097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225089097">(Feb 03 2021 at 21:57)</a>:</h4>
<p>Is there a fundamental reason that <code>clobber("all")</code> needs to be incompatible with automatic register handling? Would it be possible to say "assign registers to these arguments as normal, then clobber all the rest"?</p>



<a name="225089268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225089268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225089268">(Feb 03 2021 at 21:58)</a>:</h4>
<p>Clobbers conflict with outputs. So the same register can't be used as both an output and a clobber. If we clobber all registers then there are no registers left for LLVM to allocate for outputs.</p>



<a name="225089538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225089538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225089538">(Feb 03 2021 at 22:01)</a>:</h4>
<p>Ah. That seems like something LLVM could theoretically improve, but until then we can't really work around it, yeah.</p>



<a name="225089644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225089644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225089644">(Feb 03 2021 at 22:01)</a>:</h4>
<p><a href="https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Clobbers-and-Scratch-Registers">https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Clobbers-and-Scratch-Registers</a></p>



<a name="225089662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225089662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225089662">(Feb 03 2021 at 22:01)</a>:</h4>
<blockquote>
<p>Clobber descriptions may not in any way overlap with an input or output operand.</p>
</blockquote>



<a name="225089814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225089814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225089814">(Feb 03 2021 at 22:03)</a>:</h4>
<p>LLVM is just following GCC semantics here.</p>



<a name="225089870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225089870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225089870">(Feb 03 2021 at 22:03)</a>:</h4>
<blockquote>
<p>When the compiler selects which registers to use to represent input and output operands, it does not use any of the clobbered registers.</p>
</blockquote>



<a name="225090086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090086">(Feb 03 2021 at 22:05)</a>:</h4>
<p>Right. And that's the right thing to do in general, I think.</p>



<a name="225090111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090111">(Feb 03 2021 at 22:05)</a>:</h4>
<p>It might make sense for LLVM to have a directive that does a "clobber if not already clobbered".</p>



<a name="225090237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090237">(Feb 03 2021 at 22:06)</a>:</h4>
<p>That would allow for <code>clobber("C")</code> while still allowing register inputs to get put in registers that C calls also use.</p>



<a name="225090239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090239">(Feb 03 2021 at 22:06)</a>:</h4>
<p>This is why you can only used fixed registers if you have a wildcard clobber. Because then we know which registers to exclude from the clobber list.</p>



<a name="225090249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090249">(Feb 03 2021 at 22:07)</a>:</h4>
<p>/me nods.</p>



<a name="225090299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090299">(Feb 03 2021 at 22:07)</a>:</h4>
<p>That particular detail is something that could be enhanced in the future, but doesn't need to block stabilization.</p>



<a name="225090399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090399">(Feb 03 2021 at 22:08)</a>:</h4>
<p>And if we just add <code>clobber("C")</code> but not <code>clobber("all")</code>, you could still use that together with register inputs or outputs, as long as there are enough registers left.</p>



<a name="225090700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090700">(Feb 03 2021 at 22:10)</a>:</h4>
<p>I'm wondering if we could handle two things orthogonally...</p>



<a name="225090742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090742">(Feb 03 2021 at 22:11)</a>:</h4>
<p>The issue of target-feature-specific register clobbers being themselves target-feature-specific seems like something we could address without <em>necessarily</em> changing the clobber syntax.</p>



<a name="225090799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090799">(Feb 03 2021 at 22:11)</a>:</h4>
<p>We could recognize an output to <code>_</code> as a clobber, and allow clobbers of registers you couldn't otherwise use.</p>



<a name="225090851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090851">(Feb 03 2021 at 22:12)</a>:</h4>
<p>I do absolutely think that <code>clobber("reg")</code> is a more intuitive syntax, and that <code>clobber("C")</code> is a good idea.</p>



<a name="225090931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225090931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225090931">(Feb 03 2021 at 22:12)</a>:</h4>
<p>But allowing clobbers of target-feature-specific registers or registers you can't use as inputs/outputs could technically be done orthogonally to syntax.</p>



<a name="225091090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225091090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225091090">(Feb 03 2021 at 22:14)</a>:</h4>
<p>Which of these aspects seems like a stabilization blocker, and which is just an additional nice-to-have that we could add later?</p>



<a name="225091445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225091445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225091445">(Feb 03 2021 at 22:17)</a>:</h4>
<p>I'm not completely sure. That's why I would like to explore the design of clobbers first to make sure anything we do is still backwards-compatible.</p>



<a name="225092197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225092197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225092197">(Feb 03 2021 at 22:22)</a>:</h4>
<p>Fair.</p>



<a name="225094125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225094125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225094125">(Feb 03 2021 at 22:40)</a>:</h4>
<p>Small correction, it seems that clobbers conflict with both inputs and outputs, not just outputs.</p>



<a name="225094381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225094381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225094381">(Feb 03 2021 at 22:43)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> If we add <code>clobber("reg")</code> should we continue supporting <code>out("reg") _</code>?</p>



<a name="225094394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225094394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225094394">(Feb 03 2021 at 22:43)</a>:</h4>
<p>That's a potential breaking change.</p>



<a name="225094473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225094473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225094473">(Feb 03 2021 at 22:44)</a>:</h4>
<p>I think we should, because we need to support <code>inout("reg") expr =&gt; _</code>, so I think we also want to support that syntax for <code>out</code>.</p>



<a name="225094532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225094532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225094532">(Feb 03 2021 at 22:44)</a>:</h4>
<p>I feel a bit uneasy about have 2 ways of doing the same thing. It's poor design.</p>



<a name="225097877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225097877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225097877">(Feb 03 2021 at 23:18)</a>:</h4>
<p>It does make sense to keep the <code>=&gt; _</code> syntax, at a minimum, for the in/out cases.</p>



<a name="225098066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225098066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225098066">(Feb 03 2021 at 23:20)</a>:</h4>
<p>Oh we're definitely keeping that.</p>



<a name="225411156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225411156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225411156">(Feb 06 2021 at 13:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="143274">Amanieu</span> <a href="#narrow/stream/216763-project-inline-asm/topic/Path.20to.20stabilization/near/225083171">said</a>:</p>
<blockquote>
<p><a href="https://github.com/rust-lang/rust/issues/72016#issuecomment-761616910">https://github.com/rust-lang/rust/issues/72016#issuecomment-761616910</a></p>
</blockquote>
<p>Could we move that blocker or reference that issue comment in the top comment ?<br>
It's easier for other people to notice the state of that issue.</p>



<a name="225418556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Path%20to%20stabilization/near/225418556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Path.20to.20stabilization.html#225418556">(Feb 06 2021 at 16:11)</a>:</h4>
<p>Done</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>